//
//  THRecorderController.h
//  AVFoundationDemo
//
//  Created by rubick on 2019/1/18.
//  Copyright © 2019 LG. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN
@protocol THRecorderControllerDelegate <NSObject>
- (void)interruptionBegan;
@end

typedef void(^THRecordingStopCompletionHandler)(BOOL);
typedef void(^THRecordingSaveCompletionHandler)(BOOL, id);

@class THMemo;
@class THLevelPair;

@interface THRecorderController : NSObject

@property (nonatomic, readonly) NSString *formattedCurrentTime;
@property (weak, nonatomic) id <THRecorderControllerDelegate> delegate;


- (THLevelPair *)levels;
- (BOOL)record;
- (void)pause;
- (void)stopWithCompletionHandler:(THRecordingStopCompletionHandler)handler;
- (void)saveRecordingWithName:(NSString *)name  completionHandler:(THRecordingSaveCompletionHandler)handler;
- (BOOL)playbackMemo:(THMemo *)memo;

@end

NS_ASSUME_NONNULL_END
